#!/usr/bin/env zsh

emulate -L zsh -o err_return -o extended_glob

cp -r -- ${ZSH_SCRIPT:h}/skel/*(D) ~/

git clone -q --depth=1 https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh
git clone -q --depth=1 https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
git clone -q --depth=1 https://github.com/zsh-users/zsh-autosuggestions.git ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
git clone -q --depth=1 https://github.com/romkatv/powerlevel10k.git ~/.oh-my-zsh/custom/themes/powerlevel10k

() {
  local f
  for f in ~/.oh-my-zsh/{oh-my-zsh.sh,**/*.zsh}; do
    zcompile -R -- "$f".zwc "$f"
  done
}

make -s -C ~/.oh-my-zsh/custom/themes/powerlevel10k pkg
